<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>AppBridge交互的demo</title>
    <meta name="viewport"
          content="initial-scale=1.0, maximum-scale=1, minimum-scale=1, user-scalable=no,uc-fitscreen=yes">
    <script type="text/javascript" charset="utf-8" src="./appBridgeFun.js"></script>
</head>
<body>
<h2 id="">getUserInfo.html</h2>
<h1 id="loginBtn">跳转到登录</h1>
<h1 id="userBtn">获取用户信息</h1>
<h1 id="checkBtn">判断是否登录</h1>
<h1 id="tokenBtn">就获取用户token</h1>
<h1 id="locationBtn">获取定位信息</h1>
<h1 id="backBtn">点击返回</h1>
<h1 id="headBtn">获取头部信息</h1>
<h1 id="scanBtn">扫码</h1>
<h1 id="shareBtn">分享</h1>
<script>
    document.querySelector('#loginBtn').addEventListener("click", function () {
        AppBridgeGlobal.goToLogin(function (res) {
            alert(res)
        })
    })
    document.querySelector('#userBtn').addEventListener("click", function () {
        AppBridgeGlobal.getTMUserInfo(function (res) {
            alert(res)
        })
    })
    document.querySelector('#checkBtn').addEventListener("click", function () {
        AppBridgeGlobal.checkTMLogin(function (res) {
            alert(res)
        })
    })

    document.querySelector('#tokenBtn').addEventListener("click", function () {
        AppBridgeGlobal.getTMToken(function (res) {
            alert(res)
        })
    })
    document.querySelector('#locationBtn').addEventListener("click", function () {
        AppBridgeGlobal.getTMLocationInfo(function (res) {
            alert(res)
        })
    })
    document.querySelector('#backBtn').addEventListener("click", function () {
        AppBridgeGlobal.homeBackClicked(function (res) {
            alert(res)
        })
    })
    document.querySelector('#headBtn').addEventListener("click", function () {
        AppBridgeGlobal.getHeadInfo(function (res) {
            alert(res)
        })
    })

    document.querySelector('#scanBtn').addEventListener("click", function () {
        AppBridgeGlobal.goToQRcode(function (res) {
            alert(res)
        })
    })
    document.querySelector('#shareBtn').addEventListener("click", function () {
        AppBridgeGlobal.goToShare({ title: '测试', content: "测试内容", url: "https://www.baidu.com/", type: 2 }, function (res) {
            alert(res)
        })
    })

</script>
</body>
</html>